<!--
 * @Author: your name
 * @Date: 2021-04-21 13:48:55
 * @LastEditTime: 2021-04-21 14:15:05
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue03-demo\src\components\User.vue
-->
<template>
  <div>
    {{ msgRef }}
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  async setup () {
    const promise:Promise<string> = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve('success message')
      }, 2000)
    })
    const msg = await promise
    console.log('msg :>> ', msg)
    const msgRef = ref('')
    msgRef.value = msg
    return {
      msgRef
    }
  }
})
</script>

<style>
</style>
